<?php

namespace App\Http\Controllers\DingTalk;

use App\Http\Controllers\Controller;
use App\Models\DingTalkMessage;

class ServerController extends Controller
{
    //
    public function index()
    {
        if (post("?")) {
            return DingTalkMessage::search(post("search"))
                ->where(['dingtalk_message.kind' => 'server'])
                ->relatedJoin()
                ->getGrid();
        } else {

            return view('DingTalk.ServerController.index', F());
        }
    }


    public function browser()
    {
        return DingTalkMessage::where(["id" => get('id')])->get();
    }
}
